package es

import (
	"fmt"
	"github.com/elastic/go-elasticsearch/v7"
)

var err error
var _ *elasticsearch.Client

func Init() {

	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://localhost:9200",
		},
		// ...
	}
	_, err = elasticsearch.NewClient(cfg)
	if err != nil {
		panic(err)
	} else {
		fmt.Println("es连接成功")
	}
}
